import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../themes/appTheme.dart';

class SimpleAlertDialog extends StatelessWidget {
  SimpleAlertDialog({
    Key? key,
    this.title,
    this.message,
  }) : super(key: key);
  final String? title;
  final String? message;

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      title: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            this.title ?? '',
            style: TextStyle(
                fontSize: 30.0,
                decoration: TextDecoration.underline,
                decorationStyle: TextDecorationStyle.dotted),
          ),
          InkWell(
            onTap: () {
              Navigator.of(context).pop();
            },
            child: Icon(Icons.cancel,
                color: Get.isDarkMode ? Colors.white : Colors.blueGrey),
          ),
        ],
      ),
      titleTextStyle: TextStyle(
        letterSpacing: 1,
        color: Get.isDarkMode ? Colors.white : Colors.blueGrey,
        fontSize: 21,
      ),
      backgroundColor:
          Get.isDarkMode ? AppTheme.colors.darkTheme2 : Colors.white,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.all(
          Radius.circular(3.0),
        ),
      ),
      content: Container(
        width: 450.0,
        height: 300.0,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Expanded(
              child: Text('${this.message}'.tr),
            ),
          ],
        ),
      ),
    );
  }
}
